#include "mypushbutton.h"
#include <QDebug>
#include <QPixmap>

MyPushButton::MyPushButton(QString normalImg, QString pressImg)
{
    this->normalPath = normalImg;
    this->pressPath = pressImg;

    QPixmap pix;
    bool ret = pix.load(this->normalPath);
    if(!ret)
    {

        qDebug()<<"图片加载失败";
    }
    //设置按钮固定尺寸
    this->setFixedSize(pix.width(),pix.height());
    //设置不规则样式
    this->setStyleSheet("QPushButton{border:Opx;}");
    //设置图标
    this->setIcon(pix);
    //设置图标大小
    this->setIconSize(QSize(pix.width(),pix.height()));

}
